Hi Mike,
It isn't clear what VB technique/example you are using. An interface between VB and our C++ libraries is required. Almost a decade ago we developed a basic interface called KMviaVB that exposed a few of the KMotion Library functions that would work with the old VB6. The jogger example uses that. We'd like to get away from that. We now have a much more complete .NET interface which the Dynomotion VB example uses. Are you able to use that?
Regards TK
Group: DynoMotion |
Message: 11993 |
From: mp.3333 |
Date: 7/27/2015 |
Subject: Re: KM_MotionParams access |
Tom, I am starting with your vb example - DynoMotion VB.net using VS2008. Using this example project, can you show me code required to set MaxVelX to some value? I am assuming I would use KM_MotionParams to do this. My experience is primarily with VB6.
Thanks, Mike
|
|
Group: DynoMotion |
Message: 11998 |
From: Tom Kerekes |
Date: 7/27/2015 |
Subject: Re: KM_MotionParams access |
Hi Mike,
Yes that is correct. The Dnomotion VB.net example sets it with the statement:
_Controller.CoordMotion.MotionParams.MaxVelX = 100
Regards TK
Group: DynoMotion |
Message: 12004 |
From: mp.3333 |
Date: 7/28/2015 |
Subject: Re: KM_MotionParams access |
Tom, this looks like KFLOP code and not vb code. It would not run as is in either when copied...resulting in a compile error.
I was looking for vb.net code I could paste into your example dynomotion vb.net.
Please explain how position scaling is handled. If I run g code from kmotioncnc or from the dynomotion vb.net app, and compare position on these screens, there is scaling difference. I do not understand why that would be.
Thanks, Mike
|
|
Group: DynoMotion |
Message: 12006 |
From: Tom Kerekes |
Date: 7/28/2015 |
Subject: Re: KM_MotionParams access |
Hi Mike,
That line was taken from the Dynomotin vb.net example. Have you tried searching for it?
<>\PC VB Examples\DynoMotion VB.net\DynoMotion VB.net\DynoMotionVBnetProvider.vb ~ line 332
The code would need to be placed within the scope of the _Controller object.
"Scaling" or resolution is specified within the Motion Parameters as well as:
_Controller.CoordMotion.MotionParams.CountsPerInchX = 1000
HTH Regards TK
Group: DynoMotion |
Message: 12007 |
From: mp.3333 |
Date: 7/28/2015 |
Subject: Re: KM_MotionParams access |
Tom, OK...it is getting clearer. I was thinking I would need to use a dll ...similar to galil and others to access parameters. So, with these settings hardcoded, do you have any suggestions on how I might make one, like MaxVel, changeable via a textbox on the main vb screen?
Thanks, Mike
|
|
Group: DynoMotion |
Message: 12009 |
From: Tom Kerekes |
Date: 7/28/2015 |
Subject: Re: KM_MotionParams access |
Hi Mike,
I'm not sure I understand the question but its up to you to learn how to code GUI controls in VB. You would need to add a Text Box, then read the text, convert it to a number and store it in MaxVel.
I wouldn't think you would want something like the MaxVel to be on the main screen where an operator could change it.
Regards TK
Group: DynoMotion |
Message: 12011 |
From: mp.3333 |
Date: 7/29/2015 |
Subject: Re: KM_MotionParams access |
Tom, really just confirming best way to interface with controller. So, I am assuming that the WriteLineReadLine is the way to go. But for fast updates, is it better to use the persist block?
Regarding the MaxVel, is this the speed of a G0 move?
Thanks, Mike
|
|
Group: DynoMotion |
Message: 12012 |
From: Tom Kerekes |
Date: 7/29/2015 |
Subject: Re: KM_MotionParams access |
Hi Mike,
You would need to explain more in detail what you are trying to do.
WriteLineReadLine would be used for doing a single status request from KFLOP using a Script Command. For example for reading a variable, Input Bit, or persist variable from KFLOP.
There is a global main status record where most all of KFLOP commonly used status can be read in a single USB transaction that doesn't take much longer than reading a specific single thing. But then main status record doesn't contain all of KFLOP's memory. For example it only contains a few but not all 200 persist variables.
The persist variables reside inside KFLOP. The PC can't access them directly.
In many cases you can access KMotion Library functions to do things and it will handle the low level communication for you.
Regards TK
| | | | | | | | | |